<%@ page language="java" pageEncoding="UTF-8"%>
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ page import="java.util.*"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<div class="span12">
	<h2>
		新增
		<c:out value="${concept.conceptName }" />
		下的股票
	</h2>
	<hr>
	<form class="form-serach"
		action='<c:url value="/concept-manage/${id }/stocklist/add/query" />'
		method="get">
		<input type="text" class="input-medium search-query"
			placeholder="输入股票名或股票代码" name="n">
		<button type="submit" class="bnt">查询</button>
	</form>
	<hr>

	<form class="form-serach"
		action='<c:url value="/concept-manage/${id }/stocklist/add" />'
		method="post">
		<table class="table table-bordered table-hover">
			<thead>
				<tr>
					<th><input type="checkbox" id="checkAll" onChange="toggleAll()"></th>
					<th>No.</th>
					<th>股票名</th>
					<th>股票代码</th>
					<th>交易所</th>
					<th>大盘股</th>
					<th>300股票</th>
					<th>领头股</th>
				</tr>
			</thead>
			<tbody>
				<c:forEach var="o" items="${result.listResult }" varStatus="s">
					<tr>
						<td><input type="checkbox" name="stockIdlist"
							value="${o.id }"></td>
						<td><c:out value="${s.index + (result.pageNo - 1) * 20 + 1}" /></td>
						<td><c:out value="${o.stockName }" /></td>
						<td><c:out value="${o.stockId }" /></td>
						<td><c:out value="${o.market }" /></td>
						<td><c:if test="${o.dapanStock }">Y</c:if> <c:if
								test="${!o.dapanStock }">N</c:if></td>
						<td><c:if test="${o.threeHundredStock }">Y</c:if> <c:if
								test="${!o.threeHundredStock }">N</c:if></td>
						<td>
							<input type="checkbox" name="leadingStockIdList" value="${o.id }" />
						</td>
					</tr>
				</c:forEach>
			</tbody>
		</table>
		<button class="btn">保存</button>
		<a class="btn" href="<c:url value="/concept-manage/${id }/stocklist/" />">返回</a>
	</form>


</div>

<script type="text/javascript">
	function toggleAll() {
		if ($('#checkAll').prop("checked") == true) {
			$("input[type='checkbox'][name='stockIdlist']").prop('checked', true);
		} else {
			$("input[type='checkbox'][name='stockIdlist']").prop('checked', false);
		}
	}
</script>


